<?php

$parsed_options = array();
foreach($custom_attribute_options as $custom_attribute_option){
    $arr_row["id"] = $custom_attribute_option->getId();
    $arr_row["value"] = $custom_attribute_option->getValue();
    $parsed_options[] = $arr_row;
}

    echo
    json_encode(
        array(
            "custom_attribute_options" => $parsed_options
        )
    );
?>